package model;

import java.awt.Color;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

import service.Service;

import dao.Field;



public class SuperMob extends Mob {
	private final static int ownHp = 10;
	private static final int ownSpeed = 1;
	private static final Color orange = Color.ORANGE;
	private static BufferedImage ownImg = null;

	public SuperMob(Location location){
		super(location,ownHp,ownSpeed);
		this.setColor(orange);

		//		readPic();
		//		this.setImg(ownImg);
	}



	@Override
	public void readPic() {
		try {
			ownImg = ImageIO.read(new File("c:\\Trala.jpg"));
		} catch (IOException e) {
		}

	}



	@Override
	public Location movement(Field field) {

		Location loc = this.getLocation();
		Field tmpField = field;
		
		System.out.println(""+ loc.getCol());

			int tmpCol = loc.getCol();
			int tmpRow = loc.getRow();

			if(tmpField.getObjectAt(tmpRow+1,tmpCol)!=null){
				Location newlocation = new Location(tmpRow,tmpCol+ownSpeed);
				this.setLocation(newlocation);
				loc = newlocation;
				
			}else{
				Location newlocation = new Location(tmpRow+ownSpeed,tmpCol);
				this.setLocation(newlocation);
				loc = newlocation;
			}

		return loc;

	}


}
